<!--<?php
require_once uTemplate::PrintEot('header');
require_once(uTemplate::printEot('user_appleft'));
print <<<EOT
-->
<div class="contUser">
    <div class="p15">
			<h4 class="site"><img src="u/images/module/jobcenter.png" align="absmiddle" class="mr10" /><span>任务中心</span></h4>           	
        <div class="navC mb10">
            <ul>
                <li class="$current[1]"><a  href="jobcenter.php?action=applied"  hidefocus="true">我申请的</a></li>
                <li class="$current[0]"><a href="jobcenter.php?action=list" hidefocus="true">可申请的</a></li>
                <li class="$current[2]"><a  href="jobcenter.php?action=finish" hidefocus="true">完成的任务</a></li>
                <li class="$current[3]"><a  href="jobcenter.php?action=quit" hidefocus="true">失败的任务</a></li>
            </ul>
        </div>
        <table width="100%" height="450">
            <tr><td valign="top">
                <div>
<!--begin-->
<!--
EOT;
if( $action == "list"){
print <<<EOT
-->

<!--
EOT;
if($jobs){
print <<<EOT
-->
                    <table width="100%" style="table-layout:fixed;">
                        <tr class="user-tr">
                            <td class="b gray" width="70">任务名称</td>
                            <td>&nbsp;</td>
                            <td class="b gray" width="200">完成奖励</td>
                            <td width="190">&nbsp;</td>
                        </tr>
                        <!--点击任务名称后出现的样式-->
<!--
EOT;
foreach($jobs as $job){
print <<<EOT
-->
                        <tr class="user-tr">
                            <td><img src="$job[icon]" width="48" height="48" /></td>
                            <td class="vam user-t current">
                                <a href="javascript:;" class="text_open" hidefocus="true">$job[title]</a>
                                <p>$job[prepose]</p>
                            </td>
                            <td class="s2 vam">$job[reward]</td>
                            <td>$job[btn]</td>
                        </tr>
                        <tr class="tasks_text_tr user-tr" style="display:none;">
                            <td></td>
                            <td style="padding-top:0;">
                                <div class="tasks_text">
                                        <dl class="cc"><dt>任务描述:</dt><dd class="text">$job[description]</dd></dl>
                                        <dl class="cc"><dt>任务周期:</dt><dd>$job[period]</dd></dl>
<!--
EOT;
if($job['usergroup']){print <<<EOT
-->
                                        <dl class="cc"><dt>允许用户组:</dt><dd>$job[usergroup]</dd></dl>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if($job['number']){print <<<EOT
-->
                                        <dl class="cc"><dt>人数限制:</dt><dd>$job[number]</dd></dl>
<!--
EOT;
}print <<<EOT
-->
                                        <dl class="cc"><dt>完成条件:</dt><dd>$job[condition]</dd></dl>
                                </div>
                            </td>
                            <td colspan="2"></td>
                        </tr>
<!--
EOT;
}
print <<<EOT
-->
                        <!--结束-->
                    </table>
<!--
EOT;
}else{
print <<<EOT
-->
                    <div class="ignoreTip">还没有可申请的任务</div>
<!--
EOT;
}
print <<<EOT
-->

<!--
EOT;
}
print <<<EOT
-->
<!--
EOT;
if(empty($action) || $action == "applied"){
print <<<EOT
-->

<!--
EOT;
if($jobs){
print <<<EOT
-->
                    <table width="100%" style="table-layout:fixed;">
                        <tr class="user-tr">
                            <td class="b gray" width="70">任务名称</td>
                            <td>&nbsp;</td>
                            <td class="b gray" width="200">完成奖励</td>
                            <td width="190">&nbsp;</td>
                        </tr>
                        <!--点击任务名称后出现的样式-->
<!--
EOT;
foreach($jobs as $job){
	$processHtml = '';
	if ($job['factor'] && $job['factor']['num'] > 0 && $job['factor']['fid']) {
		$processHtml = '完成进度: ' . round($job['step']/$job['factor']['num'] * 100) . '%';
	}
print <<<EOT
-->                     <tbody id="job_$job[id]">
                        <tr class="user-tr">
                            <td><img src="$job[icon]" width="48" height="48" /></td>
                            <td class="vam user-t current">
                                <a href="javascript:;" class="text_open" hidefocus="true">$job[title]</a> $processHtml
                            </td>
                            <td class="s2 vam">$job[reward]</td>
                            <td>$job[btn]</td>
                        </tr>
                        <tr class="tasks_text_tr user-tr" style="display:none;">
                            <td></td>
                            <td style="padding-top:0;">
                                <div class="tasks_text">
                                        <dl class="cc"><dt>任务描述:</dt><dd class="text">$job[description]</dd></dl>
                                        <dl class="cc"><dt>任务周期:</dt><dd>$job[period]</dd></dl>
                                        <dl class="cc"><dt>完成条件:</dt><dd id="job_condition_$job[id]">$job[condition]</dd></dl>
                                        <dl class="cc"><dt style="padding-top:5px;">$job[qbtn]</dt></dl>
                                </div>
                            </td>
                            <td colspan="2"></td>
                        </tr>
                        </tbody>
<!--
EOT;
}
print <<<EOT
-->
                        <!--结束-->
                    </table>
<!--
EOT;
}else{
print <<<EOT
-->
                    <div class="ignoreTip">还没有已申请的任务</div>
<!--
EOT;
}
print <<<EOT
-->

<!--
EOT;
}
print <<<EOT
-->
<!--
EOT;
if($action == "finish"){
print <<<EOT
-->

<!--
EOT;
if($show == "detail"){
print <<<EOT
-->
                    <table width="100%" style="table-layout:fixed;">
                        <tr class="user-tr3">
                            <td width="80">
                                <img src="$list[icon]" width="64" height="64" />
                            </td>
                            <td>
                                <a href="profile.php?action=jobcenter&info_type=finish" class="f14 b blue mb5">$list[title]</a>
                                <p class="gray">$list[prepose]</p>
                                <div class="tasks_text">
                                    <dl class="cc"><dt>任务描述:</dt><dd class="text">$list[description]</dd></dl>
                                    <dl class="cc"><dt>任务周期:</dt><dd>$list[period]</dd></dl>
                                    <dl class="cc"><dt>任务奖励:</dt><dd><span class="s2 ">$list[reward]</span></dd></dl>
                                </div>
                            </td>
                            <td width="300">&nbsp;</td>
                        </tr>
<!--
EOT;
if($list['usergroup'] && $list['number']){print <<<EOT
-->
                        <tr class="user-tr3">
                            <td>&nbsp;</td>
                            <td style="padding-top:0;">
                                <div class="tasks_text">
<!--
EOT;
if($list['usergroup']){print <<<EOT
-->
                                    <dl class="cc"><dt>可申请用户组:</dt><dd>$list[usergroup]</dd></dl>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if($list['number']){print <<<EOT
-->
                                    <dl class="cc"><dt>人数限制:</dt><dd>$list[number]</dd></dl>
<!--
EOT;
}print <<<EOT
-->
                                </div>
                            </td>
                            <td>&nbsp;</td>
                        </tr>
<!--
EOT;
}print <<<EOT
-->
                        <tr class="user-tr3">
                            <td>&nbsp;</td>
                            <td>
                                <div class="tasks_text">
                                    <dl class="cc"><dt>完成条件:</dt><dd>$list[condition]</dd></dl>
                                </div>
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr class="user-tr3">
                            <td><img src="$list[face]" width="64" height="64" /></td>
                            <td>
                                <b class="f14">我完成的情况:</b> <span class="gray">总共参加 $list[total] 次</span>
                                <div class="tasks_text">
                                    <dl class="cc"><dt>奖励情况:</dt><dd>$list[rewardtotal]</dd></dl>
                                    <dl class="cc"><dt>最后一次:</dt><dd>$list[last]</dd></dl>
                                </div>
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr class="user-tr3">
                            <td>&nbsp;</td>
                            <td>
<!--
EOT;
if($total){
print <<<EOT
-->
                                <b class="f14"></b> <span class="gray">还有 $total 位会员参与了任务</span>
                                <ul class="cc tasks_face_list">
<!--
EOT;
foreach($others as $other){
print <<<EOT
-->
                                    <li><a href="{$db_userurl}$other[uid]"><img src="$other[face]" width="48" height="48" /></a><p><a href="{$db_userurl}$other[uid]" title="$other[username]">$other[username]</a></p></li>
<!--
EOT;
}
print <<<EOT
-->
                                </ul>
<!--
EOT;
}
print <<<EOT
-->
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                    </table>
                    <div class="tac" style=" padding:1em;width:180px;margin:0 auto;">
<!--
EOT;
if($list['isperiod']){
print <<<EOT
-->
                        <a href="javascript:;" id="apply_$list[id]"><span class="btn2"><span><button type="submit">重新申请</button></span></span></a>
<!--
EOT;
}
print <<<EOT
-->
                        <span class="bt2"><span><button onclick="top.location='jobcenter.php?action=finish'" type="submit">返回</button></span></span>
                    </div>
<!--
EOT;
}else{
print <<<EOT
-->
<!--
EOT;
if($jobs){
print <<<EOT
-->
                    <table width="100%" style="table-layout:fixed;">
                        <tr class="user-tr">
                            <td class="b gray" width="70">任务名称</td>
                            <td>&nbsp;</td>
                            <td class="b gray" width="200">完成奖励</td>
                            <td width="190">&nbsp;</td>
                        </tr>
                        <!--点击任务名称后出现的样式-->
<!--
EOT;
foreach($jobs as $job){
print <<<EOT
-->
                        <tr class="user-tr">
                            <td><img src="$job[icon]" width="48" height="48" /></td>
                            <td class="vam user-t current">
                                <p class="mb5"><a href="javascript:;" class="text_open" hidefocus="true">$job[title]</a></p><p class="gray">$job[lastfinish]</p>
                                <p>$job[prepose]</p>
                            </td>
                            <td class="s2 vam">$job[reward]</td>
                            <td>$job[btn]</td>
                        </tr>
                        <tr class="tasks_text_tr user-tr" style="display:none;">
                            <td></td>
                            <td style="padding-top:0;">
                                <div class="tasks_text">
                                        <dl class="cc one"><dt>任务描述:</dt><dd class="text">$job[description]</dd></dl>
                                        <dl class="cc"><dt>任务周期:</dt><dd>$job[period]</dd></dl>
<!--
EOT;
if($job['number']){print <<<EOT
-->
                                        <dl class="cc one"><dt>人数限制:</dt><dd>$job[number]</dd></dl>
<!--
EOT;
}print <<<EOT
-->
                                        <dl class="cc"><dt>完成条件:</dt><dd>$job[condition]</dd></dl>
                                        <dl class="cc one"><dt>&nbsp;</dt><dd><a href="jobcenter.php?action=finish&jobid=$job[id]">详细信息</a></dd></dl>
                                </div>
                            </td>
                            <td colspan="2"></td>
                        </tr>
<!--
EOT;
}
print <<<EOT
-->
                        <!--结束-->
                    </table>
<!--
EOT;
}else{
print <<<EOT
-->
                    <div class="ignoreTip">还没有已完成的任务，赶快去申请！</div>
<!--
EOT;
}
print <<<EOT
-->
<!--
EOT;
}
print <<<EOT
-->

<!--
EOT;
}
print <<<EOT
-->


<!--
EOT;
if($action == "quit"){
print <<<EOT
-->
<!--
EOT;
if($jobs){
print <<<EOT
-->
                    <table width="100%" style="table-layout:fixed;">
                        <tr class="user-tr">
                            <td class="b gray" width="70">任务名称</td>
                            <td>&nbsp;</td>
                            <td class="b gray" width="200">完成奖励</td>
                            <td width="190">&nbsp;</td>
                        </tr>
                        <!--点击任务名称后出现的样式-->
<!--
EOT;
foreach($jobs as $job){
print <<<EOT
-->
                        <tr class="user-tr">
                            <td><img src="$job[icon]" width="48" height="48" /></td>
                            <td class="vam user-t current">
                                <p class="mb5"><a href="javascript:;" class="text_open" hidefocus="true">$job[title]</a></p>
                                <p class="gray">$job[info]</p>
                                <p>$job[prepose]</p>
                            </td>
                            <td class="s2 vam">$job[reward]</td>
                            <td>$job[btn]</td>
                        </tr>
                        <tr class="tasks_text_tr user-tr" style="display:none;">
                            <td></td>
                            <td style="padding-top:0;">
                                <div class="tasks_text">
                                        <dl class="cc"><dt>任务描述:</dt><dd class="text">$job[description]</dd></dl>
                                        <dl class="cc"><dt>任务周期:</dt><dd>$job[period]</dd></dl>
<!--
EOT;
if($job['number']){print <<<EOT
-->
                                        <dl class="cc"><dt>人数限制:</dt><dd>$job[number]</dd></dl>
<!--
EOT;
}print <<<EOT
-->
                                        <dl class="cc"><dt>完成条件:</dt><dd>$job[condition]</dd></dl>
                                </div>
                            </td>
                            <td colspan="2"></td>
                        </tr>
<!--
EOT;
}
print <<<EOT
-->
                        <!--结束-->
                    </table>
<!--
EOT;
}else{
print <<<EOT
-->
                    <div class="ignoreTip">还没有失败的任务</div>
<!--
EOT;
}
print <<<EOT
-->

<!--
EOT;
}
print <<<EOT
-->
<script type="text/javascript" src="js/pw_jobcenter.js"></script>
<script>
window.onReady(function(){
	jobCenterInit();
	PW.accordion("user-t","tasks_text_tr")
})
</script>
<!--end-->
                </div>
            </td></tr>
        </table>
    </div>
</div>
<!--
EOT;
require_once uTemplate::PrintEot('footer');
?>-->